unit SmallStruct.Core.TSSRuntimeObject;

interface

uses SmallStruct.Core,
  SmallStruct.Core.TSSObject,
  SmallStruct.Core.TSSObjectContext;

type
  TSSRuntimeObject = class(TSSObject, ISSRuntimeObject)
  private
    _Context: ISSObjectContext;
  public
    function GetContext: ISSObjectContext; virtual;
    procedure SetContext(AObjectContext: ISSObjectContext);
    procedure InitObject; virtual;
  public
    destructor Destroy; override;
  end;

implementation

{ TSSRuntimeObject }

procedure TSSRuntimeObject.InitObject;
begin

end;

procedure TSSRuntimeObject.SetContext(AObjectContext: ISSObjectContext);
begin
  _Context := AObjectContext;
end;

destructor TSSRuntimeObject.Destroy;
begin
  if Assigned(_Context) then
    _Context.ReleaseObjectInstance;
  inherited;
end;

function TSSRuntimeObject.GetContext: ISSObjectContext;
begin
  Result := _Context;
end;

end.
